package com.ruoyi.system.domain;

import javax.validation.constraints.NotBlank;
import javax.validation.constraints.NotNull;
import org.apache.commons.lang3.builder.ToStringBuilder;
import org.apache.commons.lang3.builder.ToStringStyle;
import com.ruoyi.common.annotation.Excel;
import com.ruoyi.common.core.domain.BaseEntity;

/**
 * 人才库模板字段配置表 sys_talent_template_field
 * 
 * @author ruoyi
 */
public class TalentTemplateField extends BaseEntity
{
    private static final long serialVersionUID = 1L;

    /** 主键ID */
    private Long id;

    /** 模板ID */
    @Excel(name = "模板ID")
    private Long templateId;

    /** 模板表名 */
    @Excel(name = "模板表名")
    private String tableName;

    /** 字段名（英文） */
    @Excel(name = "字段名")
    private String fieldName;

    /** 字段显示名称（中文） */
    @Excel(name = "字段显示名称")
    private String fieldLabel;

    /** 字段类型 */
    @Excel(name = "字段类型")
    private String fieldType;

    /** 字段长度 */
    @Excel(name = "字段长度")
    private Integer fieldLength;

    /** 排序 */
    @Excel(name = "排序")
    private Integer sortOrder;

    /** 列宽（像素） */
    @Excel(name = "列宽")
    private Integer columnWidth;

    /** 是否必填（0否 1是） */
    @Excel(name = "是否必填", readConverterExp = "0=否,1=是")
    private String isRequired;

    /** 单元格类型配置JSON */
    @Excel(name = "单元格类型配置")
    private String cellTypeConfig;
    
    /** 原始字段信息（临时字段，用于字段变更检测，不持久化） */
    private TalentTemplateField originalField;

    /** 状态（0正常 1停用） */
    @Excel(name = "状态", readConverterExp = "0=正常,1=停用")
    private String status;

    public Long getId()
    {
        return id;
    }

    public void setId(Long id)
    {
        this.id = id;
    }

    @NotNull(message = "模板ID不能为空")
    public Long getTemplateId()
    {
        return templateId;
    }

    public void setTemplateId(Long templateId)
    {
        this.templateId = templateId;
    }

    @NotBlank(message = "模板表名不能为空")
    public String getTableName()
    {
        return tableName;
    }

    public void setTableName(String tableName)
    {
        this.tableName = tableName;
    }

    @NotBlank(message = "字段名不能为空")
    public String getFieldName()
    {
        return fieldName;
    }

    public void setFieldName(String fieldName)
    {
        this.fieldName = fieldName;
    }

    @NotBlank(message = "字段显示名称不能为空")
    public String getFieldLabel()
    {
        return fieldLabel;
    }

    public void setFieldLabel(String fieldLabel)
    {
        this.fieldLabel = fieldLabel;
    }

    public String getFieldType()
    {
        return fieldType;
    }

    public void setFieldType(String fieldType)
    {
        this.fieldType = fieldType;
    }

    public Integer getFieldLength()
    {
        return fieldLength;
    }

    public void setFieldLength(Integer fieldLength)
    {
        this.fieldLength = fieldLength;
    }

    public Integer getSortOrder()
    {
        return sortOrder;
    }

    public void setSortOrder(Integer sortOrder)
    {
        this.sortOrder = sortOrder;
    }

    public Integer getColumnWidth()
    {
        return columnWidth;
    }

    public void setColumnWidth(Integer columnWidth)
    {
        this.columnWidth = columnWidth;
    }

    public String getIsRequired()
    {
        return isRequired;
    }

    public void setIsRequired(String isRequired)
    {
        this.isRequired = isRequired;
    }

    public String getCellTypeConfig()
    {
        return cellTypeConfig;
    }

    public void setCellTypeConfig(String cellTypeConfig)
    {
        this.cellTypeConfig = cellTypeConfig;
    }

    public TalentTemplateField getOriginalField()
    {
        return originalField;
    }

    public void setOriginalField(TalentTemplateField originalField)
    {
        this.originalField = originalField;
    }

    public String getStatus()
    {
        return status;
    }

    public void setStatus(String status)
    {
        this.status = status;
    }

    @Override
    public String toString() {
        return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE)
            .append("id", getId())
            .append("templateId", getTemplateId())
            .append("tableName", getTableName())
            .append("fieldName", getFieldName())
            .append("fieldLabel", getFieldLabel())
            .append("fieldType", getFieldType())
            .append("fieldLength", getFieldLength())
            .append("sortOrder", getSortOrder())
            .append("columnWidth", getColumnWidth())
            .append("isRequired", getIsRequired())
            .append("cellTypeConfig", getCellTypeConfig())
            .append("status", getStatus())
            .append("createBy", getCreateBy())
            .append("createTime", getCreateTime())
            .append("updateBy", getUpdateBy())
            .append("updateTime", getUpdateTime())
            .append("remark", getRemark())
            .toString();
    }
}

